package kr.hkit.Powerjava.chapter12.Work;



public class Person implements Comparable<Person> {
	private String name;
	private int height;
	
	
	public Person(String name) {
		super();
		this.name = name;
	}
	public Person() {
		super();
	}
	public Person(String name, int height) {
		super();
		this.name = name;
		this.height = height;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getHeight() {
		return height;
	}
	public void setHeight(int height) {
		this.height = height;
	}
	@Override
	public String toString() {
		return String.format("[%s, %s]", name, height);
	}
		@Override
	public int compareTo(Person o) {
		 
		return (this.name.hashCode()-o.name.hashCode());
	}
		@Override
	public boolean equals(Object obj) {
		
		return this.name.equals(((Person)obj).getName());
	}
		
	
	
	

}
